<?php
class Mageex_Robot_IndexController extends Mage_Core_Controller_Front_Action
{
    public function indexAction()
    {
    	echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8">';
		//Mage::helper('robot/rss')->rssPost($keyword='', 12, 12, 'http://www.amazon.com/rss/people/AJM38DLD0P3H8/products/ref=tag_rsh_hl_ersp_ppl');
		//$url= "http://news.yahoo.com/rss/education;_ylt=As.RkCuU4ONe7ltXKjlYdBe5scB_;_ylu=X3oDMTFocmRrcXR2BG1pdANSU1MgU2l0ZUluZGV4IFVTBHBvcwMxMARzZWMDTWVkaWFSU1NFZGl0b3JpYWw-;_ylg=X3oDMTFrM25vcXFyBGludGwDdXMEbGFuZwNlbi11cwRwc3RhaWQDBHBzdGNhdAMEcHQDc2VjdGlvbnMEdGVzdAM-;_ylv=3";
		//$url = "http://ecx.images-amazon.com/images/I/41Xx9W8gdRL.jpg";
		//$url = "http://www.24h.com.vn/upload/rss/bongda.rss";
		$results = Mage::helper('robot/ebay')->ebayPost("laptop", 1, 1, 'all');
		
		echo '<pre>';
		print_r($results);
		echo '</pre>';
		
		//echo Mage::helper('robot/func')->saveImage($url, 'test');
	}
	public function testAction()
	{
		$robotModel = Mage::getModel('robot/robot');
		
		$robotCollection = $robotModel->getCampaignsAvailable();
		
		foreach ( $robotCollection as $collection ) {
			//Test
			echo '<pre>';
			print_r(explode('<br />', nl2br($collection->getKeyword())));
			echo '</pre>';
			
		}
	}
}